1. Field of the Invention
The present invention relates to an apparatus for writing information that writes data in a recording medium and further writes control information related to the data-writing in a predetermined control region of the recording medium. The present invention further relates to a method of writing information in which data is written in a recording medium and control information related to the data-writing is further written in a predetermined control region of the recording medium. The present invention yet further relates to a computer program that causes a computer to perform steps related to the information-writing.
2. Description of the Related Art
A rewritable DVD disk such as a DVD+RW disk needs to be formatted before user data is written therein.
In response to a user's request for formatting the DVD+RW disk, dummy data is written in the DVD+RW disk. However, once dummy data have been written in a portion of the lead-in region of the DVD+RW disk, the user is notified that the formatting of the DVD+RW disk has been completed. While the DVD+RW disk is not accessed in response to a user's request, dummy data is written in the remaining region of the DVD+RW disk. This is called background formatting.
Conventionally, the user needs to spend a long time for formatting, but the user does not need to wait until the background formatting is completed.
In the background formatting, dummy data is continuously written starting with the inner circumference. In response to a user's request for writing user data, the background formatting is suspended, and a Last Written Address (LWA) indicating the last address in which dummy data has been written is updated. Then, the user data is written.
After the user data is completely written, the background formatting is resumed with the LWA.
While the DVD+RW disk is background formatted, the user can write user data in any data region of the DVD+RW disk.
That is to say, the user can write user data in a region in which dummy data has not been written yet. As a result, if the user data is written during the background formatting, a region in which data has been written and another region in which no data has been written coexist in the same disk.
When the background formatting is resumed in a state in which a region in which data has been written and another region in which no data has been written coexist in the same disk, it is necessary to write dummy data in a region other than a region in which the user data has been written. This is the reason why, for example, many information storage apparatuses use one bit flag (bit map information) indicating the state of a unit region (in the case of DVD+RW disk, 1 ECC block=16 sectors) of whether data has been written.
That is, if the user writes user data in a region outer than the LWA, the flag in the bit map corresponding to the region is set “data-written.”
When the background formatting is resumed, the bit map information is referred to so that dummy data is written only in a region in which the user data has not been written yet.
In the case of a DVD+RW disk, the user can even suspend the background formatting, and remove the disk.
In this case, the LWA and the bit map information are written in a Formatting Disk Control Block (FDCB) in the lead-in region.
When a disk that has not yet been fully formatted is inserted, and the disk is formatted in the background, the FDCB enables dummy data to be written only in regions in which no data has been written.
As described above, in the case in which the background formatting is suspended and the disk is removed, the FDCB is indispensable for knowing the writing state of the disk. If an error occurs in the updating of the FDCB, such a problem that the user data written by the user is overwritten with dummy data during the background formatting may occur.
On the other hand, if the FDCB is updated too often, the performance of data-writing in response to a user's request may be lowered, and/or the disk may be degraded.
To avoid such problems, in the case of conventional information storage apparatuses, the FDCB is updated at a predetermined time after the user data has been written and before the background formatting is resumed, for example, the time when a user's request for discharging the disk or suspending the background formatting. According to this arrangement, the FDCB can be updated at a suitable timing even during the background formatting. Since the FDCB is updated after the user data has been fully written, the FDCB is updated without lowering the performance of data-writing (See Japanese Patent Laid-Open Application No. 2003-45117, for example).
However, the conventional information storage apparatuses still has the following unsolved problems.
For example, the DVD+RW disk can be used for applications such as the real-time recording of a television program. It is required to write data at a relatively low average data transfer rate and at a constant interval for the real-time data-writing. As a result, if real-time data-writing is required during the background formatting, dummy data is not written for the formatting but user data is kept being written for the time period of recording.
In other words, while the real-time data is being written, the conventional information storage apparatuses described above do not have a chance to update the FDCB. For example, if the power provided to the conventional information storage apparatuses unexpectedly fails due to power failure while the real-time data is being written, the conventional information storage apparatuses cannot normally update the FDCB.
If a disk of which FDCB has not been normally updated is inserted and the background formatting is resumed, the written user data may be overwritten with dummy data since the LWA and the bitmap information are incorrect.